<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Article extends MY_Controller {

	function detail($id){
		$article_info = get_field_by_where("articles","*","id='{$id}'");
		if(!$article_info){
			show_error("404 data not defined");
            exit;
		}
		$article_info['add_time'] = date("Y-m-d H:i:s", $article_info['add_time']);
		$this->smarty->assign("article_info", $article_info);
		$this->db->set("read_number", "read_number + 1", false);
		$this->db->where("id", $id);
		$this->db->update("articles");
		$this->smarty->display("h5/article_detail.html");
	}
}